package org.blog.helper;


public class Result<T> {
	private T data;
	private String msg;
	private int code;

	public Result(int code) {
		this(null, code);
	}

	public Result(T data, int code) {
		this(data, code, null);
	}

	public Result(T data, int code, String msg) {
		this.code = code;
		this.data = data;
		this.msg = msg;
	}

	public T getData() {
		return data;
	}

	public void setData(T data) {
		this.data = data;
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	public int getCode() {
		return code;
	}

	public void setCode(int code) {
		this.code = code;
	}

	public String toJSONString() {
		return JsonMapper.toJsonString(this);
	}
}
